import Vue from 'vue'
import App from './App.vue'
// 三级联动全局组价
import TypeNav from './components/TypeNav'
import Carousel from './components/Carousel'
import Pagination from './components/Pagination'
import { Button, MessageBox } from 'element-ui'
// 第一个参数全局组件名字，参数2：哪个组件
Vue.component(TypeNav.name, TypeNav)
Vue.component(Carousel.name, Carousel)
Vue.component(Pagination.name, Pagination)
Vue.component(Button.name, Button)
Vue.prototype.$msgbox = MessageBox
Vue.prototype.$alert = MessageBox.alert
// 引入路由
import router from '@/router/index'
// 引入仓库
import store from './store'
// 引入mockServer.js
import '@/mock/mockServer'
// 引入swiper样式
import 'swiper/css/swiper.css'
// // 测试
// import {reqCategoryList} from '@/api';
// reqCategoryList()
import * as API from '@/api'
// 引入图片懒加载插件
import VueLazyload from 'vue-lazyload'
import atm from '@/assets/atm.gif'
// 注册插件
Vue.use(VueLazyload, {
  loading: atm,
});

// 引入自定义插件
import myPlugins from './plugins/myPlugins'
Vue.use(myPlugins,{
  name:'upper'
})
// 引入表单校验插件
import "@/plugins/validate"
new Vue({
  render: (h) => h(App),
  beforeCreate() {
    Vue.prototype.$bus = this
    Vue.prototype.$API = API
  },
  router,
  store,
}).$mount('#app')
